﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Dapper.Moon
{
    public interface IUpdateable<T>
    {
        IUpdateable<T> Updateable(T t);
        IUpdateable<T> Updateable();
        IUpdateable<T> Where(Expression<Func<T, bool>> where);
        IUpdateable<T> SetColumns(Expression<Func<T, object>> columns);
        IUpdateable<T> SetColumns(string[] columns);
        /// <summary>
        /// 忽略列
        /// </summary>
        /// <param name="columns"></param>
        /// <returns></returns>
        IUpdateable<T> IgnoreColumns(Expression<Func<T, object>> columns);
        IUpdateable<T> IgnoreColumns(string[] columns);
        IUpdateable<T> SetColumns(string sql, object param = null);
        /// <summary>
        /// 设置表名
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="isQuote">是否转义</param>
        /// <returns></returns>
        IUpdateable<T> TableName(string tableName = null, bool isQuote = true);
        IUpdateable<T> Limit(int limit);
        int Execute();
        Task<int> ExecuteAsync();
        SqlBuilderResult ToSql();
    }
}
